function model = ensemble_wrap2(coverMat, stegoMat, loops, d_sub, L, ratio, verbose)
%% ensemble_wrap2(cover, stego, loop, d_sub,L,ratio,verbose)
% scripts to use ensemble easily.
% settings for ensemble:
%   seed_trntst (random value)
%   cover <= 'tmp_cover.mat' (F: coverMat, names: auto generated)
%   stego <= 'tmp_stego.mat' (F: stegoMat, names: auto generated)
%   d_sub <= d_sub
%   L <= L
%   verbose <= verbose
%
% input:
%   coverMat : M*N matrix for training data (class 0).
%   stegoMat : L*N matrix for training data (class 1).
%   d_sub : 'automatic'(default) or number
%   L     : 'automatic'(default) or number
%   ratio : value between 0..1
%
% output:
%   model : output from ensemble.

if nargin < 3
    loops = 1;
end
if nargin < 4
    d_sub = 'automatic';
end
if nargin < 5
    L = 'automatic';
end
if nargin < 6
    ratio = 0.5;
end
if nargin < 7
    verbose = 0;
end

cover = struct('F', coverMat);clear coverMat
stego = struct('F', stegoMat);clear stegoMat
err=0;

for i = 1:loops
settings = struct('cover', cover, 'stego', stego, ...
    'seed_trntst', randi(100000), 'd_sub', d_sub, 'L', L, ...
    'verbose', verbose, 'ratio', ratio);
model(i) = ensemble(settings);
err=err+model(i).testing_error;
end
disp(err/loops)
end
